//C11:ep11_7_3.c: three students scores,used dynamic linklist.
// delete node.
struct student_st *del(struct student_st *head, long num)
{   
    struct student_st *p1, *p2;
    if(head == NULL)
    {
        printf("\nlist is null!\n");
        return head;
    }

    p1 = head;
    //find the node,which is able to delete.
    while(num != p1->num && p1->next != NULL)
    {
        p2 = p1;
        p1 = p1->next;
    }

    if(num == p1->num)
    {
        if(p1 == head)
        {
            head = p1->next;
        }
        else
        {
            p2->next = p1->next;
            printf("delete:%ld\n", num);
            n = n - 1;
        }
    }
    else
    {
        printf("%ld not been found!\n", num);
    }
    return head;
}